package com.szxy.frontend.portal.feign;

import com.szxy.pojo.*;
import com.szxy.utils.CatResult;
import com.szxy.utils.PageResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Auther:zwer
 * @Date:2019/9/10 20:36
 * @Description:com.szxy.frontend.portal.feign
 * @Version:1.0
 **/
@FeignClient("common-items")
public interface CommonItemsFeignClient {

    //----------------------/service/item
    @RequestMapping(value = "/service/item/selectTbItemAllByPage", method = RequestMethod.GET)
    PageResult selectTbItemAllByPage(@RequestParam("page") Integer page,
                                     @RequestParam("rows") Integer rows);

    @PostMapping("/service/item/insertTbItem")
    Integer insertTbItem(@RequestBody TbItem item);

    @PostMapping("/service/item/updateItemById")
    Integer updateItemById(@RequestBody TbItem item);

    @PostMapping("/service/item/findItemById")
    public TbItem findItemById(@RequestParam("itemId") Long itemId);

    //---------------------/service/itemCategory
    @RequestMapping(value = "/service/itemCategory/selectItemCategoryByParentId", method = RequestMethod.GET)
    List<TbItemCat> selectItemCategoryByParentId(@RequestParam("id") Long id);

    @GetMapping("/service/itemCategory/findItemCatByItemId")
    TbItemCat findItemCatByItemId(@RequestParam("cid") Long cid);

    @GetMapping("/service/itemCategory/selectItemCategoryAll")
    CatResult selectItemCategoryAll();
    //---------------------/service/itemParam
    @GetMapping("/service/itemParam/selectItemParamByItemCatId")
    TbItemParam selectItemParamByItemCatId(@RequestParam("itemCatId") Long itemCatId);

    @PostMapping("/service/itemParam/insertTbItemParam")
    Integer insertTbItemParam(@RequestBody TbItemParam itemParam);

    @GetMapping("/service/itemParam/selectItemParamAll")
    PageResult selectItemParamAll(@RequestParam("page") Integer page,
                                  @RequestParam("rows") Integer rows);

    @GetMapping("/service/itemParam/deleteItemParamById")
    int deleteItemParamById(@RequestParam Long id);

    //---------------------/service/itemDesc
    @PostMapping("/service/itemDesc/insertItemDesc")
    Integer insertItemDesc(@RequestBody TbItemDesc itemDesc);

    @GetMapping("/service/itemDesc/findItemDescByItemId")
    public TbItemDesc findItemDescByItemId(@RequestParam("itemId") Long itemId);

    @PostMapping("/service/itemDesc/updateItemDescByItemId")
    int updateItemDescByItemId(@RequestBody TbItemDesc itemDesc);

    //-------------------/service/itemParamItem
    @PostMapping("/service/itemParamItem/insertTbItemParamItem")
    Integer insertTbItemParamItem(@RequestBody TbItemParamItem itemParamItem);

    @GetMapping("/service/itemParamItem/findItemParamItemByItemId")
    TbItemParamItem findItemParamItemByItemId(@RequestParam("itemId") Long itemId);

    @PostMapping("/service/itemParamItem/updateItemParamItemByItemId")
    int updateItemParamItemByItemId(@RequestBody TbItemParamItem itemParamItem);

}
